package cn.valorin.via;

import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;

public class Via {
    public static Material ink_sack;
    public static Material cooked_fish;
    public static Material grilled_pork;
    public static Material crops;
    public static Material leaves;
    public static Material soil;
    public static Material long_grass;
    public static Material seeds;
    public static ItemStack white_stained_glass_pane;
    public static ItemStack gray_stained_glass_pane;
    public static ItemStack black_stained_glass_pane;
    
    public static void initial() {
    	if (Material.getMaterial("INK_SACK") != null) {
    		ink_sack = Material.getMaterial("INK_SACK");
    	} else {
    		ink_sack = Material.getMaterial("LEGACY_INK_SACK");
    	}
    	
    	if (Material.getMaterial("COOKED_FISH") != null) {
    		cooked_fish = Material.getMaterial("COOKED_FISH");
    	} else {
    		cooked_fish = Material.getMaterial("COOKED_COD");
    	}
    	
    	if (Material.getMaterial("GRILLED_PORK") != null) {
    		grilled_pork = Material.getMaterial("GRILLED_PORK");
    	} else {
    		grilled_pork = Material.getMaterial("COOKED_PORKCHOP");
    	}
    	
    	if (Material.getMaterial("CROPS") != null) {
    		crops = Material.getMaterial("CROPS");
    	} else {
    		crops = Material.getMaterial("WHEAT");
    	}
    	
    	if (Material.getMaterial("LEAVES") != null) {
    		leaves = Material.getMaterial("LEAVES");
    	} else {
    		leaves = Material.getMaterial("OAK_LEAVES");
    	}
    	
    	if (Material.getMaterial("SOIL") != null) {
    		soil = Material.getMaterial("SOIL");
    	} else {
    		soil = Material.getMaterial("FARMLAND");
    	}
    	
    	if (Material.getMaterial("LONG_GRASS") != null) {
    		long_grass = Material.getMaterial("LONG_GRASS");
    	} else {
    		long_grass = Material.getMaterial("GRASS");
    	}
    	
    	if (Material.getMaterial("SEEDS") != null) {
    		seeds = Material.getMaterial("SEEDS");
    	} else {
    		seeds = Material.getMaterial("WHEAT_SEEDS");
    	}
    	
    	if (Material.getMaterial("STAINED_GLASS_PANE") != null) {
    		white_stained_glass_pane = new ItemStack(Material.getMaterial("STAINED_GLASS_PANE"));
    		gray_stained_glass_pane = new ItemStack(Material.getMaterial("STAINED_GLASS_PANE"),1,(short)7);
    		black_stained_glass_pane = new ItemStack(Material.getMaterial("STAINED_GLASS_PANE"),1,(short)15);
    	} else {
    		white_stained_glass_pane = new ItemStack(Material.getMaterial("WHITE_STAINED_GLASS_PANE"));
    		gray_stained_glass_pane = new ItemStack(Material.getMaterial("GRAY_STAINED_GLASS_PANE"));
    		black_stained_glass_pane = new ItemStack(Material.getMaterial("BLACK_STAINED_GLASS_PANE"));
    	}
    }
}
